package com.accesshollywood.xmas2011.core;

import org.jbox2d.collision.shapes.PolygonShape;
import org.jbox2d.common.Vec2;

public class EllipseShape extends PolygonShape {
	public EllipseShape(float W, float H, int count) {
		float step = (float) (2.0 * Math.PI / (float)count);
		Vec2[] vertices = new Vec2[count];
		float angle = 0;
		for(int i = 0; i < count; i++){
			angle += step;
			vertices[i] = new Vec2((float)(W * Math.cos(angle)), (float)(H * Math.sin(angle)));
		}
		this.set(vertices, vertices.length);// .setAsBox(48/DPI, 65/DPI);
	}
}
